import java.util.Scanner;

public class Ex4_8{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		System.out.print("Enter the number of students: ");
		int num = input.nextInt();
		System.out.println("Enter students' names and scores:");
		String name;
		double score;
		String maxName = input.next();
		double maxScore = input.nextDouble();
		for (int i = 0; i < num-1; i++){
			name = input.next();
			score = input.nextDouble();
			if (score > maxScore){
				maxScore = score;
				maxName = name;
			}
		}
		System.out.printf("%s\t%.1f\n", maxName, maxScore);
	}
}
